<template>
  <div class="suspension-cart-box">
    <div class="price-box">
      <p>{{totalprice | currency}}</p>
    </div>
    <div class="count-box">
      <img src="http://static.52letsgo.cn/zz/wechatimg/ic_home_cart.png" alt="">
      <p>{{num}}</p>
      <p>份</p>
    </div>
  </div>
</template>
<script>
  import {fmoney} from './../../../commons/js/utils'
  export default{
    props: {
      num: {
        type: Number,
        default(){
          return 0;
        }
      },
      totalprice: {
        type: Number,
        default(){
          return 0;
        }
      }
    },
    filters:{
      currency:function (value) {
//        if (!value) return ''
        value = fmoney(value,2);
        return ("¥"+value)
      }
    }
  }
</script>
<style>
  .suspension-cart-box {
    width: 80px;
    height: 80px;
    background: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    border-radius: 50%;
  }

  .suspension-cart-box .price-box {
    display: flex;
    color: orange;
  }

  .suspension-cart-box .count-box {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
  }

  .suspension-cart-box .count-box img {
    height: 30px;
    width: 30px;
    padding-right: 5px;
  }
</style>
